package cc.linker.steplink.crm.dao;

import cc.linker.steplink.crm.domain.ActionContent;
import cc.linker.steplink.crm.domain.ContentAction;
import cc.linker.steplink.crm.domain.Customer;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

public interface SyncContentDao {
    Customer findCustomerByOpenidAndToken(@Param("openid") String openid, @Param("token") String token);

    Customer findCustomerByCustomerId(@Param("customerId") String customerId);

    Customer findCustomerByGlobalOpenid(String globalOpenid);

    Integer updateCustomerSetOpenid(Customer customer);

    Integer updateCustomerSetGlobalOpenid(Customer globalOpenid);

    Integer addContentUserAction(ActionContent actionContent);
    
    Date findLatestActionTime();

    Integer updateCustomerSetOrgId(Customer oneCustomer);

    Integer isExitCustomerAction(ContentAction contentAction);

    void addContentActionFromMq(ContentAction contentAction);

    void addReadTimesByArticleId(String newsId);

    Integer judgeArticleIfRead(@Param("token") String token,@Param("openid") String openid,@Param("newsId") String newsId);

    String getLabelIdsByArticleId(String newsId);

    void addReadTimesByLabelIds(String[] split);
}
